﻿@model List<wne.models.UserModel>
@{
    ViewBag.Title = "AllUsersPage";
}
@functions
{
}
<script>
    $("#search-block-form_and_sort").submit(function()
    {

    });
</script>
<script src="/Scripts/User.js"></script>

<div class="modalContent" id="addUser">
    @Html.Partial("AddUser")
</div>
    <div class="hero-unit" style="padding: 14px 10px 14px 20px; margin-left: 2px;">
        <h2>Пользователи системы</h2>
        <div class="row-fluid">
            <div class="span3" style="padding-top: 40px; text-align: center;">
                <a href="javascript:void(0)" onclick="showModal('addUser')" class="btn btn-primary">Добавить пользователя</a>
            </div>
            
            <select name="OrderNum" id="OrderNum" class="relative inline-block" size="1" onchange="reloadUserPartial()">
                <option value="1">Сортировать по алфавиту А-Я</option>
                <option value="2">Сортировать по алфавиту Я-А</option>
            </select>   
            
            <select name="GroupId" id="groupList" class="relative inline-block" size="1" onchange="reloadUserPartial()">
                <option value="-1">Выберите группу</option>
                @foreach (var group in ViewBag.AllGroups)
                {
                    <option value="@group.Key">@group.Value</option>
                }
            </select> 
            
            <div class="offset1 span3" style="padding-top: 40px;">
                <div class="input-append">
                    <input type="text" id="searchString" class="span9 input-medium search-query" name="searchString" value="" maxlength="128" placeholder="Поиск по имени">
                    <button type="button" class="btn" onclick="reloadUserPartial();"><i class="icon-search" onclick="reloadUserPartial();"></i></button>
                    <div onclick="$('#search-block-form_and_sort').submit();"></div>
                </div>
            </div>  
        </div>
    </div>
    

    @*<div class="wraper clearfix">
        <div class="paging fleft">
            <a href="javascript:void(0);" class="next"><< Предыдущая</a>
            <div class="btn"><a href="javascript:void(0);">1</a></div>
            <div class="btn"><a href="javascript:void(0);">1</a></div>
            <div class="btn"><a href="javascript:void(0);">1</a></div>
            <a href="javascript:void(0);" class="next">>> Следующая</a>
        </div>
        <div class="fright">
            Колличество пользователей на странице:<br />
            <input type="radio" name="Pageamount" value="10"/>
            10
            <input type="radio" name="Pageamount" value="50" checked="checked" />
            50
            <input type="radio" name="Pageamount" value="100" />
            100
        </div>
    </div>*@

<div id="userPartial">
@Html.Partial("pAllUsers",Model)
    </div>
